<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet" href="__CSS__/pintuer.css?v={$src_version}">
<link rel="stylesheet" href="__CSS__/admin.css?v={$src_version}">
<link rel="stylesheet" href="__CSS__/responsive.css?v={$src_version}">
<script src="__JS__/jquery-3.2.1.min.js?v={$src_version}"></script>
<script src="__JS__/pintuer.js?v={$src_version}"></script>
<script src="__JS__/jquery.nicescroll.js"></script>
<script src="__PUBLIC__/layer.js?v={$src_version}"></script>
<script src="__JS__/ming.js?v={$src_version}"></script>
<script src="__JS__/ifram_scroll.js?v={$src_version}"></script>
<script src="__JS__/responsive.js?v={$src_version}"></script>   
<body>
 
<div class="panel admin-panel ">
  <div class="panel-head" id="add"><strong><span class="icon-pencil-square-o"></span>添加/修改</strong></div>
  <div class="body-content">
    <form method="post" class="form-x" id="frm" action="">
     
    <div class="form-group">
        <div class="label">
          <label><strong style="color:#f00;">*</strong>项目名称</label>
        </div>
        <div class="field">
           <input type="text" class="input w50"   id="pname"   value="{$edit.pname}"  name="pname" maxlength="100"   />    
        </div>

    </div>      
    
    <div class="form-group">
        <div class="label">
          <label><strong style="color:#f00;">*</strong>项目类型</label>
        </div>
        <div class="field">
            <select class="input w50" name="opt" id="opt">
             <option value="0">请选择</option>
             <option  <if condition="$edit['opt'] eq '+'"> selected</if> value="+" >加分项目</option>
             <option  <if condition="$edit['opt'] eq '-'"> selected</if> value="-" >减分项目</option>
            </select>
        </div>

    </div>      
    
  <div class="form-group">
        <div class="label">
          <label><strong style="color:#f00;">*</strong>积分数量</label>
        </div>
        <div class="field">
           <input type="text" class="input w50"   id="point"   value="{$edit.point}"  name="point" maxlength="11"   />    
        </div>

    </div>      
    
      
      <div class="form-group">
        <div class="label">
          <label></label>
        </div>
        <div class="field">
          <input type="hidden" name="id" value="{$edit.pid}" />
          <input type="hidden" name="act" value="add" />
          <div class="button-group">
             <a class="button bg-main" href="javascript:;" id="sbt">
               <span class="icon-check-square-o"></span> 提交
             </a>  
       
             <a class="button border-main" href="javascript:history.go(-1)">
             <span class="icon-mail-reply"></span> 返回</a>
           </div> 
        </div>
      </div>
    </form>
  </div>
</div>
<script type="text/javascript">
  $(function(){
    $('#sbt').click(function(){
		
		  var pname=$.trim($('#pname').val());
		  
		  var opt=$('#opt').val();
		  
		  var point=$.trim($('#point').val());
		 
		   if(pname=='')
		   {
			  layer.msg('请填写项目名称',{icon:2});
			  
			  return false;
			  
		   }
		   
		   if(opt=='0')
		   {
			  layer.msg('请选择项目类型',{icon:2});
			  
			  return false;
			  
		   }
		   if(point==''||point=='0')
		   {
			  layer.msg('请填写积分数量',{icon:2});
			  
			  return false;
			  
		   }
		  if(!is_int(point))
		   {
			  layer.msg('请正确填写积分数量',{icon:2});
			  
			  return false;
			  
		   }
  
		 $.mAjax("{:U('Project/add')}",$('#frm').serialize(),'json','sbt','提交中...','<span class="icon-check-square-o"></span> 提交');
		
		});	  
		
	  

   });
   
   
 
</script>
</body>
</html>